import java.util.HashSet;
import java.util.Set;

/**
 * @author LKQ
 * @date 2022/1/31 10:07
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        System.out.println(solution.numDifferentIntegers("u"));
    }
    public int numDifferentIntegers(String word) {
        int n = word.length();
        int left = 0, right = 0;
        Set<String> set = new HashSet<>();
        while (right < n) {
            while (right < n && word.charAt(right) > 57) {
                // 识别到字母
                right++;
            }
            if (right == n) {
                // 全是字母
                break;
            }
            left = right;
            while (right < n && word.charAt(right) <= 57) {
                // 识别到数字
                right++;
            }
            while (left < n && word.charAt(left) == '0') {
                // 去除前导0
                left++;
            }
            set.add(word.substring(left, right));
        }
        return set.size();
    }
}
